#include <stdio.h>
int main (void)
{
	int day, time;
	printf ("Type the day and time of interest\n\n");
	scanf ("%d%d", &day, &time);
	if (day <= 5)
	{
		if (time <= 900)
			printf ("Rest\n\n");
		else
		{
			if (time <= 1700)
				printf ("Work\n\n");
			else
				printf ("Relax\n\n");
		}
	}
	else
	{
		if (time <= 1100)
			printf ("Rest\n\n");
		else
			printf ("Have fun\n\n");
	}
}
